//-----------------------------------------------------------------------
// <copyright file="HelpCatService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class HelpCatService
    {
        #region HelpCat

        public static void CreateHelpCat(HelpCat helpCat)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                helpCatDAO.CreateHelpCat(helpCat);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateHelpCatException, ex);
            }
        }        

        public static void UpdateHelpCat(HelpCat helpCat)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                helpCatDAO.UpdateHelpCat(helpCat);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateHelpCatException, ex);
            }
        }        

        public static void DeleteHelpCat(long catId)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                helpCatDAO.DeleteHelpCat(catId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteHelpCatException, ex);
            }
        }
        
        public static HelpCat GetHelpCat(long catId)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                return helpCatDAO.GetHelpCat(catId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetHelpCatException, ex);
            }
        }                

        public static HelpCatCollection GetHelpCatList(HelpCatColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                return helpCatDAO.GetHelpCatList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetHelpCatListException, ex);
            }
        }        

        public static HelpCatCollection GetHelpCatList(HelpCatColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                return helpCatDAO.GetHelpCatList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetHelpCatListException, ex);
            }
        }        

	    public static HelpCatCollection GetHelpCatListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                return helpCatDAO.GetHelpCatListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetHelpCatListException, ex);
            }
        }        

        public static HelpCatCollection GetHelpCatListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                HelpCatDAO helpCatDAO = new HelpCatDAO();
                return helpCatDAO.GetHelpCatListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetHelpCatListException, ex);
            }
        }        

        #endregion
    }
}